home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4710 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.lpr.carel.fi!usenet
  2. From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: HELP : getkey
  5. Date: Tue, 06 Feb 1996 17:53:08 +0200
  6. Organization: Carelcomp Forest
  7. Message-ID: <31177964.5B11@cmt.lpr.mail.carel.fi>
  8. References: <4f74ms$hll@winx03.informatik.uni-wuerzburg.de>
  9. NNTP-Posting-Host: renoir.cclahti.carel.fi
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b6a (WinNT; I)
  14.  
  15. Martin Lehmann wrote:
  16. > --
  17. > Hello !
  18. > How do I make it to wait for a key pressed on the console (GNU C) ?
  19. > I tried the following thing (using the CURSES-Libraray):
  20. >    char key;
  21. >    key = getch();
  22. > This has the disadvantage, that the program is waiting for a key EXCLUSIVELY
  23. > and nothing else can be done. What I want is to REACT on keys pressed within
  24. > a bigger loop. I do not want to wait for the user having pressed a key; the
  25. > program should continue :
  26. > [rest snipped]
  27.  
  28. Check out poll (or pollfd). I found it handy in some *nixes, but alas cannot tell if Linux 
  29. contains it. (Or man -k poll.)
  30.  
  31. Later, 
  32.  AriL
  33. -- 
  34. All my opinions are mine and mine alone.
  35.